package com.yang.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * @author yangdacheng
 * @title: PageInfo 页面大小配置类
 * @projectName note_api
 * @description: TODO
 * @date 2022/3/23 6:59 下午
 */
@NoArgsConstructor
@ToString
@Data
@Accessors(chain = true)
public class PageInfo {
    private Integer pageSize; //页面大小
    private Integer nowPage; //当前页面
    private Integer allCount; //数据总量
    private Integer startPage;

    public PageInfo(Integer pageSize, Integer nowPage, Integer allCount) {
        this.pageSize = pageSize;
        this.nowPage = nowPage;
        this.allCount = allCount;
        this.startPage = pageSize * nowPage;
    }
}
